#include <dolphin/socket.h>
int SOClose ( int s );
SOClose() closes the socket descriptor.
The following table summarizes the SOClose() behavior for the
SO_SOCK_STREAM (TCP) socket when the SO_O_NONBLOCK flag
is not set with
SOFcntl():
SOLinger |
Description |
onoff = 0 (default) |
SOClose() returns as quickly as possible and all data is
transmitted in the background. |
onoff = 1 |
SOClose() returns immediately and the current connection is
aborted. |
onoff = 1 |
SOClose() blocks until all data is transmitted for up to
the specified linger time. |
If the SO_O_NONBLOCK flag is set, SOClose() aborts the
TCP connection immediately.
s |
The socket descriptor to be closed. |
| zero | Succeeded. |
SO_EBADF |
Bad socket descriptor. |
SO_ENETRESET |
Socket library is not initialized. |
Note: Additional errors may be generated and returned in future library releases. All the negative return values must be treated as generic errors.
SOFcntl,
SOLinger,
SOGetSockOpt(),
SOSetSockOpt(),
SOShutdown()